"""mydjango URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from django.views.static import serve
from myapp.views import myindex,MyView

from myapp.views import AddUser,UpdateUser,DeleteUser

#用户表
from myapp.md_user import Register,MyCode,Login,wb_back,ding_back,UploadFile,Upload_User,QiNiu,UpdateUser,\
    UserInfo

#幻灯片表
from myapp.md_pics import InsertPics
from myapp.md_pics import Delete_Pics,PicsList

#商品表
from myapp.md_goods import ValidationAdmin,InsertGoods,GoodsList,\
    GoodsItem,TagMongo,InsertTags,GetTags,\
    RedisTags,UpdateGoods,UpdateTags,GetOnLine,GetNum,GetGoodsNum,\
    GetCommentUsername,\
    InsertComment,CommentList,CommentMongo,UserList,Goods_Comment_List,\
    UidFlow,GoodFlow_User,GetFlow,FlowNum,GoodsClick,GoodRank,GoodsSearch

#   GetCommentUsername  根据评论表uid获取用户名

# from myapp.exam_week_test import Register_Week,Login_Week,ding_back
# from myapp.zhouce_4 import Goods_Info


urlpatterns = [
    #定义超链接路由
    re_path('^static/upload/(?P<path>.*)$',serve,{'document_root':'/static/upload/'}),
    path('',MyView.as_view()),
    #后台用户增删改查表(8000端口下)
    path('adduser',AddUser.as_view()),
    path('updateuser',UpdateUser.as_view()),
    path('deleteuser',DeleteUser.as_view()),
    path('register/',Register.as_view()),
    path('mycode/',MyCode.as_view()),
    path('login/',Login.as_view()),

    #美多商城用户表相关
    path('md_admin/weibo/',wb_back),
    path('dingding_back/',ding_back),
    path('uploadfile/',UploadFile.as_view()),
    path('upload_user/',Upload_User.as_view()),
    path('uptoken/',QiNiu.as_view()),
    path('updateuser/',UpdateUser.as_view()),
    path('userinfo/',UserInfo.as_view()),

    #美多商城活动表相关(幻灯片)
    path('insertpics/',InsertPics.as_view()),
    path('picslist/',PicsList.as_view()),

    # 美多商城幻灯片表(删除)路由地址
    path('delete_pics/', Delete_Pics.as_view()),

    #美多商城商品表相关
    path('getusertype/', ValidationAdmin.as_view()),    #判定用户身份信息
    path('insertgoods/', InsertGoods.as_view()),
    path('goodslist/', GoodsList.as_view()),
    path('goodsitem/', GoodsItem.as_view()),
    path('tagmongo/', TagMongo.as_view()),
    path('inserttags/', InsertTags.as_view()),
    path('gettags/', GetTags.as_view()),
    path('redistags/', RedisTags.as_view()),
    path('updategoods/', UpdateGoods.as_view()),
    path('updatetags/', UpdateTags.as_view()),
    path('getonline/', GetOnLine.as_view()),
        #获取点击量
    path('getnum/', GetNum.as_view()),
        #商品访问量数据接口
    path('goodsnum/', GetGoodsNum.as_view()),
        #商品评论
    path('insertcomment/', InsertComment.as_view()),
    path('commentlist/', CommentList.as_view()),
        #根据评论表uid获取user表用户名
    path('gcuname/', GetCommentUsername.as_view()),
        #评论存入MongoDB
    path('commentmongo/', CommentMongo.as_view()),
    path('userlist/', UserList.as_view()),
    path('gclist/', Goods_Comment_List.as_view()),

    #用户收藏接口
    path('uidflow/', UidFlow.as_view()),
        #查询关注该商品的用户数量
    # path('goodflow_num/', GoodFlow_num.as_view()),
        #查询关注该商品用户的用户名
    path('goodflow_username/', GoodFlow_User.as_view()),
        #商品关注添加删除
    path('getflow/', GetFlow.as_view()),
        #查询商品关注者用户名及关注者数量
    path('flownum/', FlowNum.as_view()),
    path('goodsclick/', GoodsClick.as_view()),
    path('goodrank/', GoodRank.as_view()),
        #商品搜索
    path('goodssearch/', GoodsSearch.as_view()),

    # # 考试路由
    # path('register_week/',Register_Week.as_view()),
    # path('login_week/',Login_Week.as_view()),
    # path('dingding_back/',ding_back),

    #周测4路由
    # path('goods_info/', Goods_Info.as_view()),



]
